package com.bzyd.cloud.fallback;

import com.bzyd.cloud.feign.ProductService;
import com.bzyd.cloud.pojo.Product;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 容错类要求必须实现被容错的接口，并为每个方法实现容错方案
 * Created by Xianyue Dang on 2021/8/18
 */
@Component
@Slf4j
public class ProductServiceFallBack implements ProductService {
    @Override
    public Product findById(Integer pid) {
        Product product = new Product();
        product.setPid(-1);
        return product;
    }

    @Override
    public void reduceInventory(Integer pid, int num) {

    }
}
